#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))

require "#{LKP_SRC}/lib/string_ext"

$stdin.gets
$stdin.gets

num_objs = 0
num_pages = 0

while (line = $stdin.gets)
  line = line.resolve_invalid_bytes
  v = line.split
  pagesperslab = v[5].to_i
  num_slabs = v[14].to_i
  num_pages += num_slabs * pagesperslab
  num_objs += v[2].to_i
end

puts "num_objs: #{num_objs}"
puts "num_pages: #{num_pages}"
